package com.online.websocketcluster.controller;

import com.online.websocketcluster.service.SessionManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 坐席请求信息及登录校验服务
 * @author hsc
 * @create 2018-04-24 16:44
 */
@RestController
public class AgentServerController {

    @Autowired
    private SessionManageService sessionManageService;

    /**
     * 坐席登录校验
     * @return 检验结果
     */
    @PostMapping(value = "/checkToken")
    public Map checkToken(@RequestBody Map map){
        Map result = sessionManageService.checkToken(map);
        return result;
    }

    /**
     * 坐席请求未读消息
     * @return 信息列表
     */
    @PostMapping("/getMessages")
    public Map unreadMessages(@RequestBody Map map){

        Map result = sessionManageService.getMessages(map);
        return result;
    }
}
